Use job backoff times in the case of high failure rates
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 16 Jul 2014 00:22:39 +0000 (17:22 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 16 Jul 2014 00:22:39 +0000 (17:22 -0700)
Change-Id: Ica0c81bfb127e858ec6f1aa193da351930493b2d

maintenance/runJobs.php

index 9b86e1b..1383a8a 100644 (file)
@@ -131,8 +131,11 @@ class RunJobs extends Maintenance {
                                        $this->runJobsLog( $job->toString() . " t=$timeMs good" );
                                }
 
-                               // Back off of certain jobs for a while
+                               // Back off of certain jobs for a while (for throttling and for errors)
                                $ttw = $this->getBackoffTimeToWait( $job );
+                               if ( $status === false && mt_rand( 0, 49 ) == 0 ) {
+                                       $ttw = max( $ttw, 30 );
+                               }
                                if ( $ttw > 0 ) {
                                        $jType = $job->getType();
                                        $backoffs[$jType] = isset( $backoffs[$jType] ) ? $backoffs[$jType] : 0;